function FirstClassDecorator(params: any) {
  console.log('111 >>', params);
  // 当修饰器带参数时 需要返回一个函数 返回的这个新的函数才是用来修饰对应的类的
  return (TargetClass: typeof CustomerDecorator) => {
    console.log('() =>');
    const res = new TargetClass();
    console.log(res.name);
    console.log('222 >>>', params);
  };
}

/**
 * 不带参数的装饰器
 */
@FirstClassDecorator('我是参数')
class CustomerDecorator {
  name: string = '下单';
  constructor() {}
  buy() {
    console.log(this.name, '购买');
  }
  placeOreder() {
    console.log(this.name, '下单购买');
  }
}

export {};
